package utils {
	
	public class MessageMap {
		
		//------------------------------------------------------------
        //
        // class variables
        //
        //------------------------------------------------------------
		
		private static var _map:Object = {}
		
		private static var _instance:MessageMap;
		
		//------------------------------------------------------------
        //
        // methods
        //
        //------------------------------------------------------------
		
		/**
		 * get the message according to error code
		 */
		public static function getMessage(errorCode:String):String {
			if (!_instance) {
				_instance = new MessageMap();
			}
			
			return _map[errorCode];
		}
		
		//------------------------------------------------------------
        //
        // constructor
        //
        //------------------------------------------------------------
		
		public function MessageMap() {
			if (_instance) {
            	throw new Error("Instance already exists.");
   			}
			
			_map["2"] = "Message 2";
			_map["3"] = "Message 3";
		}

	}
}